library ieee;
use ieee.std_logic_1164.all;

entity point is
	port	(	clk		: 	in bit;
				reset    : 	in std_logic;
				dead		: 	in std_logic;
				led1		:	out bit_vector (6 downto 0);
				led2		:	out bit_vector (6 downto 0);	
				led3		:	out bit_vector (6 downto 0));
end entity;

architecture point_arch of point is
	signal	count_aux	:	natural	:=0;
	signal		div	: natural	:= 0;
	signal		quo	: natural	:= 0;
	signal		div2	: natural	:= 0;	
begin
	p0:	process (clk, reset)
		variable clk_count	: 	natural 	:=0;
	begin
		if reset = '1' then
			clk_count	:= 0;
			count_aux <= 0;
		elsif  clk'event and clk = '1' then
			
			if dead = '0' then
				clk_count := clk_count + 1;
			else
				clk_count := clk_count;
			end if;
			
			if (clk_count = 25_000_000) then
				count_aux <= count_aux + 1;
				clk_count	:= 0;
			end if;
		end if;
	end process;
	
	p1:	process (count_aux)
		variable		div	: natural	:= 0;
		variable		quo	: natural	:= 0;
		variable		div2	: natural	:= 0;	
	begin
		if count_aux < 10 then
			led2 <= "1000000";
			led3 <= "1000000";
			if count_aux = 0 then led1 <= "1000000";
			elsif count_aux = 1 then led1 <= "1111001";
			elsif count_aux = 2 then led1 <= "0100100";
			elsif count_aux = 3 then led1 <= "0110000";
			elsif count_aux = 4 then led1 <= "0011001";
			elsif count_aux = 5 then led1 <= "0010010";
			elsif count_aux = 6 then led1 <= "0000010";
			elsif count_aux = 7 then led1 <= "1111000";
			elsif count_aux = 8 then led1 <= "0000000";
			else led1 <= "0010000";
			end if;
		elsif count_aux < 100 then
			quo	:= count_aux rem 10;
			div	:= count_aux/10;
			led3 <= "1000000";
			if quo = 0 then led1 <= "1000000";
			elsif quo = 1 then led1 <= "1111001";
			elsif quo = 2 then led1 <= "0100100";
			elsif quo = 3 then led1 <= "0110000";
			elsif quo = 4 then led1 <= "0011001";
			elsif quo = 5 then led1 <= "0010010";
			elsif quo = 6 then led1 <= "0000010";
			elsif quo = 7 then led1 <= "1111000";
			elsif quo = 8 then led1 <= "0000000";
			else led1 <= "0010000";
			end if;

			if div = 0 then led2 <= "1000000";
			elsif div = 1 then led2 <= "1111001";
			elsif div = 2 then led2 <= "0100100";
			elsif div = 3 then led2 <= "0110000";
			elsif div = 4 then led2 <= "0011001";
			elsif div = 5 then led2 <= "0010010";
			elsif div = 6 then led2 <= "0000010";
			elsif div = 7 then led2 <= "1111000";
			elsif div = 8 then led2 <= "0000000";
			else led2 <= "0010000";
			end if;
		else
			quo	:= count_aux rem 100;
			div	:= (count_aux/10);
			div 	:= div rem 10;
			div2	:= count_aux /100;
			if quo = 0 then led1 <= "1000000";
			elsif quo = 1 then led1 <= "1111001";
			elsif quo = 2 then led1 <= "0100100";
			elsif quo = 3 then led1 <= "0110000";
			elsif quo = 4 then led1 <= "0011001";
			elsif quo = 5 then led1 <= "0010010";
			elsif quo = 6 then led1 <= "0000010";
			elsif quo = 7 then led1 <= "1111000";
			elsif quo = 8 then led1 <= "0000000";
			else led1 <= "0010000";
			end if;

			if div = 0 then led2 <= "1000000";
			elsif div = 1 then led2 <= "1111001";
			elsif div = 2 then led2 <= "0100100";
			elsif div = 3 then led2 <= "0110000";
			elsif div = 4 then led2 <= "0011001";
			elsif div = 5 then led2 <= "0010010";
			elsif div = 6 then led2 <= "0000010";
			elsif div = 7 then led2 <= "1111000";
			elsif div = 8 then led2 <= "0000000";
			else led2 <= "0010000";
			end if;
			
			if div2 = 0 then led3 <= "1000000";
			elsif div2 = 1 then led3	<= "1111001";
			elsif div2 = 2 then led3 <= "0100100";
			elsif div2 = 3 then led3 <= "0110000";
			elsif div2 = 4 then led3 <= "0101100";
			elsif div2 = 5 then led3 <= "0010010";
			elsif div2 = 6 then led3 <= "0000010";
			elsif div2 = 7 then led3 <= "1111000";
			elsif div2 = 8 then led3 <= "0000000";
			else led3 <= "0010000";
			end if;	
		end if;	
	end process;	
end architecture;